﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AiLuWeb.Model;
using AiLuWeb.WebSite.Code;
using AiLuWeb.Business;
using Ajeelee.Core.Utils;

namespace AiLuWeb.WebSite
{
    public partial class message : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPost)
            {
                try
                {
                    Message info = new Message();
                    info.Username = Utility.StripHTML(FormParam("username"));
                    info.Tel = Utility.StripHTML(FormParam("tel"));
                    info.Email = Utility.StripHTML(FormParam("email"));
                    info.Content = Utility.StripHTML(FormParam("content"));
                    info.InTime = DateTime.Now;
                    info.InIP = IPAddress;
                    new MessageBusinessFactory().CreateMessageBusiness().Insert(info);

                    MessageBoxGo("提交成功！", "/message.aspx");
                }
                catch (Exception ex)
                {
                    Function.WriteErrorLog(ex);
                }
            }
        }
    }
}